<template>
  <div class="weui-cell">
    <div class="weui-cell__bd">{{device.lable}}</div>
    <div class="weui-cell__ft" style="width: 80%">
      <slider show-value :value="device.value" :min="device.min" :max="device.max" @change="action" />
    </div>
  </div>
</template>

<script>
import { publishMessage } from "@/utils";
export default {
  name: "mpvue-button",
  data() {
    return {};
  },
  props: {
    device: Object
    // {
    //   type: "slider",
    //   lable: "R",
    //   key: "R",
    //   value: 0,
    //   min: 0,
    //   max: 255
    // }
  },
  mounted() {
    console.log(this.device);
  },
  methods: {
    action(e) {
      publishMessage(`{"${this.device.key}":${e.mp.detail.value}}`);
    }
  }
};
</script>

<style>
</style>
